import { BasicColumn } from '@/components/Table';
export interface ListData {
  id: number;
  name: string;
  sex: string;
  avatar: string;
  email: string;
  city: string;
  status: string;
  type: string;
  createDate: string;
}
const days: number = getDaysInCurrentMonth();
const arr: BasicColumn<ListData>[] = [
  {
    title: 'id',
    key: 'id',
  },
  {
    title: '姓名',
    key: 'name',
    width: 100,
  },
];

for (let index = 0; index < days; index++) {
  const i: string = (index + 1).toString();
  arr.push({ title: i, key: index + 1, width: 80 });
}
arr.push(
  {
    title: '考勤提醒次数',
    key: 'city',
    width: 140,
  },
  {
    title: '出勤天数',
    key: 'city',
    width: 100,
  },
  {
    title: '合同日发工资',
    key: 'city',
    width: 140,
  },
  {
    title: '绩效工资',
    key: 'city',
    width: 100,
  },
  {
    title: '本月应发工资',
    key: 'city',
    width: 140,
  },
  {
    title: '本人签字确认',
    key: 'city',
    width: 140,
  },
  {
    title: '手印',
    key: 'city',
    width: 100,
  },
  {
    title: '备注',
    key: 'city',
    width: 100,
  }
);
export const columns: BasicColumn<ListData>[] = [...arr];

function getDaysInCurrentMonth() {
  const date = new Date();
  // 获取下个月的当前日期
  date.setMonth(date.getMonth() + 1);
  // 将日期设置为0，这样会自动回退到上个月的最后一天
  date.setDate(0);
  // 返回当前月份的天数
  return date.getDate();
}
